drpfTest - sample code to call DinkeyRemote Modules in VB.NET
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This project is written in Visual Studio 2002 but will work in more recent
versions of Visual Studio (they will upgrade the Project to the latest version.
If prompted you should also upgrade the .NET framework the project requires).

For users of Visual Studio 2005 or higher, the default setting to projects is to
compile for the Target Platform "Any". This means that on 32-bit Windows, your
code will run as 32-bit code (and needs to call DinkeyRemote32.dll) and under 64-bit
Windows your code will run as 64-bit code (and needs to call DinkeyRemote64.dll).
The sample code works this out automatically. If you select the target platform as "x86"
then it will always be 32-bit and so you only need to use DinkeyRemote32.dll. If you
select "x64" then your code will be 64-bit and you only need to use DinkeyRemote64.dll.

The main source files in the project are:

drpf.vb - the source file contains declarations of our API. We automatically
          work out whether your code is running in 32-bit or 64-bit and load
          the appropriate DinkeyRemote module.
                  
Form1.vb - this is the sample code giving an example on how you can call our API.
           It contains 2 functions. Just use the function most appropriate for you
           and customise in your own way. 
       
The best approach is to compile the sample code and see how it works and then to take
the appropriate code and apply it to your own project. You should include the drpf.vb
file in your project and use/modify which ever functions from Form1.vb you feel are
appropriate. The drpf.vb file should not be modified.           
           
The sample code is just a guide. As none of the parameters are security sensitive then
there is no need to implement strong security in calling DinkeyRemote.

Make sure you remember to do the following when creating your own project:

1) Insert the following namespaces in your code file:
using System.Runtime.InteropServices;

2) Insert the drpf.cs file in your project.

3) You need to put DinkeyRemote32.dll and/or DinkeyRemote64.dll into the folder that
contains drpfTest. Otherwise the message "Unable to open DLL (DinkeyRemote32.dll)" or
the System.DllNotFoundException error will appear when you run drpfTest.

Notes on Debugging 64-bit Code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you use the 64-bit module (DinkeyRemote64.dll) the anti-debug code is so strong
that if you are debugging your code, after calling our API then it will crash with
an SEH exception. There are no debug modules for DinkeyRemote so you will have to
find other ways of debugging your code (for example taking out the call altogether).
